<template>
<div>
  <div>
    <div>
      <el-button type="success" @click="loadData">请求接口-测试</el-button>
    </div>
    <div>
      {{msg}}
    </div>
    <div>
      <h1>令牌：{{store.state.token}}</h1>
    </div>
  </div>
</div>
</template>

<script setup>
import {ref} from "vue";
import axios from "axios";
import { useStore } from 'vuex'

const store = useStore()
const  msg=new ref("");

const loadData=()=>{
  //请求接口
  axios.get("raffle/all").then(res=>{
    if(res.data.code==0){
      msg.value=res.data.msg;
    }
  })
}
</script>

<style scoped>

</style>
